Managed HVM guests are not displayed by 'xm list' after restarting xend.
authorJim Fehlig <jfehlig@novell.com>
Wed, 14 Mar 2007 00:13:11 +0000 (18:13 -0600)
committerJim Fehlig <jfehlig@novell.com>
Wed, 14 Mar 2007 00:13:11 +0000 (18:13 -0600)
This patch prevents writing empty configuration items to the domain's
sexpr configuration file.  Without the empty items, the sexpr is
parsed properly when xend is started.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
tools/python/xen/xend/XendConfig.py

index 0cc7c7c3a0019bdf65ae8411fe9029a7f53bd724..e36e89a0dfb347997653e5d9a1b2fb7347956354 100644 (file)
@@ -730,7 +730,7 @@ class XendConfig(dict):
             
             for key in XENAPI_PLATFORM_CFG:
                 val = sxp.child_value(image_sxp, key, None)
-                if val is not None:
+                if val is not None and val != '':
                     self['platform'][key] = val
             
             notes = sxp.children(image_sxp, 'notes')
@@ -1359,7 +1359,7 @@ class XendConfig(dict):
 
         for key in XENAPI_PLATFORM_CFG:
             val = sxp.child_value(image_sxp, key, None)
-            if val is not None:
+            if val is not None and val != '':
                 self['platform'][key] = val
 
         notes = sxp.children(image_sxp, 'notes')